<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript运算符与表达式</title>
</head>
<body>
    <h1>JavaScript运算符与表达式</h1>
    <script>
        let a=1;
        let b=2;
        //运算符
        let sum=a+b;
        sum+=1;
        //求余运算
        console.log(3.2%2);
        //结构运算符
        let [v1,v2,v3]=[1,2,3];
        console.log(v1);

        //比较运算符 相等（==）与不等（！=）以及严格相等（====）严格不等（！==）
        console.log(1=="1");
        console.log(1==="1");
        console.log(1==true);
        console.log(3>2);
        console.log(3>"a");

        //逻辑运算符 短路运算
        console.log(a>=1&&b<2);
        console.log(a==1?"是":"否");
        
        //位运算
        console.log(a&b);

        //字符串连接运算符+
        console.log("a="+a);

        console.log(typeof a);
    </script>
    <a href="javascript:void(0)">无点击效果</a>
</body>
</html>